#include <boost/lexical_cast.hpp>
#include <boost/uuid/nil_generator.hpp>
#include <boost/uuid/uuid_generators.hpp>
#include <boost/uuid/uuid_io.hpp>

#include "uuid.h"

namespace Uuids
{

std::string uuidToString(const Uuid& uuid)
{
    return boost::uuids::to_string(uuid);
}

Uuid stringToUuid(const std::string& uuid)
{
    if (uuid.empty())
        return boost::uuids::nil_uuid();

    return boost::lexical_cast<Uuids::Uuid>(uuid);
}

Uuid nilUuid()
{
    return boost::uuids::nil_uuid();
}

Uuid newUuid()
{
    return boost::uuids::random_generator()();
}

} // namespace Uuids
